package com.pdsu.graduation_design.adapter;

import com.pdsu.graduation_design.domain.Commodity;
import com.pdsu.graduation_design.domain.CommodityType;

import java.util.List;

import q.rorbin.verticaltablayout.adapter.TabAdapter;
import q.rorbin.verticaltablayout.widget.ITabView;
import q.rorbin.verticaltablayout.widget.QTabView;

public class MainActivityBarAdapter implements TabAdapter {



    private List<CommodityType> menu_types;

    public MainActivityBarAdapter(List<CommodityType> menu_types) {
        this.menu_types = menu_types;
    }

    @Override
    public int getCount() {
        return menu_types.size();
    }

    @Override
    public ITabView.TabBadge getBadge(int position) {
        return null;
    }

    @Override
    public ITabView.TabIcon getIcon(int position) {
        return null;
    }

    @Override
    public ITabView.TabTitle getTitle(int position) {



        QTabView.TabTitle title = new QTabView.TabTitle.Builder()
                .setContent(menu_types.get(position).getType())//设置数据   也有设置字体颜色的方法
                .build();
        return title;
    }

    @Override
    public int getBackground(int position) {

        return 0;

    }


}
